package com.guigu.basedservice.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.guigu.basedservice.dto.ProductDto;
import com.guigu.basedservice.mapper.ProductDtoMapper;
import com.guigu.basedservice.service.ProductDtoService;
import com.guigu.basedservice.vo.BasePartsTypeVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author heyuhang
 * @create 2024/10/8
 */
@Service
public class ProductDtoServiceImpl implements ProductDtoService {

    @Autowired(required = false)
    private ProductDtoMapper productDtoMapper;

    @Override
    public PageInfo<ProductDto> getBaseCarPartsSku(Integer currentPage, Integer pageSize, BasePartsTypeVo vo) {
        PageHelper.startPage(currentPage,pageSize);
        List<ProductDto> list= productDtoMapper.getBaseCarPartsSku(vo);
        PageInfo<ProductDto> pageInfo=new PageInfo<>(list);
        return pageInfo;
    }

    @Override
    public ProductDto getOne(String id) {
        return productDtoMapper.getOne(id);
    }

    @Override
    public List<ProductDto> listProductDto() {
        return productDtoMapper.listProductDto();
    }


}
